<template>
  <div class="box">
    <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
      <van-swipe-item
        class="imgs"
        v-for="(bannersss, index) in imgs"
        :key="index"
      >
        <img :src="'/imgs/' + bannersss" alt="" />
      </van-swipe-item>
    </van-swipe>
  </div>
</template>

<script>
import axios from "axios";
import Vue from "vue";
import { Swipe, SwipeItem } from "vant";

Vue.use(Swipe);
Vue.use(SwipeItem);

export default {
  name: "bannerPhone",
  components: {},
  data() {
    return {
      imgs: [],
    };
  },
  created() {
    axios({
      url: "/bannerImgsphone",
    }).then((res) => {
      this.imgs = res.data;
      console.log(this.imgs);
    });
  },
};
</script>

<style scoped>
.box {
  height: 5.7rem;
  width: 100%;
}
.my-swipe .van-swipe-item {
  height: 5.7rem;
  width: 100%;
}
.imgs {
  height: 5.7rem;
  width: 100%;
}
.imgs img {
  height: 5.7rem;
  width: 100%;
}
</style>
